/*
 * Superclass of 'Patient', 'Doctor', and 'Nurse'
 */
import java.io.Serializable;
import java.security.MessageDigest;	// This is for security purposes

public class Member implements Serializable {
	private String firstName;
	private String lastName;
	private String password;
	private String userName;
	private int ID;
	private String address;
	
	
	//constructor
	public Member(String f, String l, MessageDigest p, String u, String a, int id) {
		firstName = f;
		lastName = l;
		password = p.toString();
		userName = u;
		ID = id;
		address = a;
	}
	
	
	//Getter methods
	public String getFirstName() {
		return firstName;
	}
	
	
	public String getLastName() {
		return lastName;
	}
	
	public String getUserName() {
		return userName;
	}
	
	
	public int getID() {
		return ID;
	}
	
	
	public String getAddress() {
		return address;
	}
	
	
	//Setter methods
	public void setFirstName(String f) {
		firstName = f;
	}
	
	
	public void setLastName(String l) {
		lastName = l;
	}
	
	
	public void setID(int id) {
		ID = id;
	}
	
	
	public void setAddress(String a) {
		address = a;
	}
	
	public String toString()
	{
		String str = this.userName + ": " + this.lastName + ", " + this.firstName;
		return str;
	}
	
	// This checkPass has been updated to compare secure message digests 
	// instead of plain-text
	public boolean checkPass(MessageDigest p) {
		return (p.toString()).equals(password); 
	}
	
}
